package nl.grol.yakshop.domain.model;

import java.util.List;

import org.joda.time.DateTime;

import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;

/**
 * @author mgrol
 *
 */
public class YakHerd {
	private String name;
	private DateTime startOfShop;
	private List<YakI> yaks;
	
	public YakHerd( String name, DateTime startOfShop, List<YakI> yaks ) {

		Preconditions.checkArgument(name != null);
		Preconditions.checkArgument(startOfShop != null);
		Preconditions.checkArgument(yaks != null);

		this.name = name;
		this.startOfShop = startOfShop;
		this.yaks = yaks;
	}
	
	public String getName() {
		return name;
	}

	public DateTime getStartOfShop() {
		return startOfShop;
	}

	public ImmutableList<YakI> getYaks() {
		return ImmutableList.copyOf(yaks);
	}

	public String toString() {
		 return Objects.toStringHelper(this)
	       .add("startOfShop", this.startOfShop)
	       .add("yaks.size", this.yaks.size())
	       .toString();
	}	
}
